﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework_2
{
    class Oblong : Shape, GetArea
    {
        private double length, width, area;
       public Oblong(double length,double width)
        {
            this.length = length;
            this.width = width;
            if (length<=0 ||width<=0)
            {
                this.islegal = false;
            }
            this.getArea();
        }
        public override double getArea()
        {
            area = length * width;
            return area;
            throw new NotImplementedException();
        }

        public override string showInfo()
        {
            if (this.islegal)
            {
                string info = "\n创建了一个长方形，长为" + this.length + "，宽为" + this.width + "，面积为" + this.area;
                return info;
            }
            throw new NotImplementedException();
        }
    }
}
